package com.bhs.sansong.adapter;

import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bhs.sansong.R;
import com.bhs.sansong.bean.TabBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class TypeAdapter extends BaseQuickAdapter<TabBean, BaseViewHolder> {

    public TypeAdapter( @Nullable List<TabBean> data) {
        super(R.layout.item_line, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, TabBean item) {
        TextView tvName=helper.getView(R.id.tv_name);
        tvName.setText(item.getTypeName());
        tvName.setBackgroundResource(item.isChecked()?R.drawable.bg_blue_4:R.drawable.border_black_4);
        tvName.setTextColor(mContext.getColor(item.isChecked()?R.color.white:R.color.black));
    }
}
